import torch
from torch.autograd import Function
from torch.nn import Module

import torch_npu
import ads_c


class PointsInBoxFunction(Function):
    @staticmethod
    def forward(ctx, boxes, pts):
        result = ads_c.npu_points_in_box(boxes, pts)
        ctx.save_for_backward(result)
        return result

    @staticmethod
    def backward(ctx, grad_output):
        return None

npu_points_in_box = PointsInBoxFunction.apply